import { createFunctionHandler, RabbitMQClient } from "@roasmax/rabbitmq";
import RedisToolkit from "@roasmax/redis";
import { WeiboPost } from '@roasmax/weibo-types';

export const createOnWeiboDetail = (redis: RedisToolkit, rabbitmq: RabbitMQClient) => {
    return createFunctionHandler(async (taskData: any) => {
        const payload = taskData as { type: string, timestamp: any, data: WeiboPost }
        console.log('Received task:', Object.keys(taskData));
        /**
         * 1. redis 存储统计数据
         * 2. mongodb 存储原始数据
         * 3. 发送数据给 RabbitMq
         */
        return { processed: false, error: `method not implements` };
    })
}